import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/refund_order_list_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class RefundOrderListEntity {
  late int code = 0;
  late String msg;
  late List<RefundOrderListData> data = [];

  RefundOrderListEntity();

  factory RefundOrderListEntity.fromJson(Map<String, dynamic> json) =>
      $RefundOrderListEntityFromJson(json);

  Map<String, dynamic> toJson() => $RefundOrderListEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class RefundOrderListData {
  late int id;
  @JSONField(name: "order_no")
  late String orderNo;
  @JSONField(name: "order_goods_id")
  late int orderGoodsId;
  late int type;
  late int num;
  @JSONField(name: "total_price")
  late String totalPrice;
  late int status;
  @JSONField(name: "store_id")
  late int storeId;
  @JSONField(name: "store_name")
  late String storeName;
  @JSONField(name: "retreat_title")
  late String retreatTitle = '';
  @JSONField(name: "retreat_details")
  late String retreatDetails = '';
  @JSONField(name: "sku_data")
  late List<RefundOrderListDataSkuData> skuData;
  @JSONField(name: "img_path")
  late String imgPath;

  @JSONField(name: "is_show_express")
  late int isShowExpress = 0;
  @JSONField(name: "goods_name")
  late String goodsName;

  RefundOrderListData();

  factory RefundOrderListData.fromJson(Map<String, dynamic> json) =>
      $RefundOrderListDataFromJson(json);

  Map<String, dynamic> toJson() => $RefundOrderListDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class RefundOrderListDataSkuData {
  @JSONField(name: "sku_key")
  late String skuKey;
  @JSONField(name: "sku_val")
  late String skuVal;

  RefundOrderListDataSkuData();

  factory RefundOrderListDataSkuData.fromJson(Map<String, dynamic> json) =>
      $RefundOrderListDataSkuDataFromJson(json);

  Map<String, dynamic> toJson() => $RefundOrderListDataSkuDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
